using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace LunarWorldSDK.Serialization
{
    /// <summary>
    /// Serializable Vector3
    /// </summary>
    [System.Serializable]
    public class Vector3s 
    {
        public float x, y, z;
        
        public override string ToString()
        {
            return ToVector3().ToString();
        }

        private Vector3 ToVector3()
        {
            return new Vector3(x, y, z);
        }

        private Vector2 ToVector2()
        {
            return new Vector2(x, y);
        }

        public Vector3s() { }

        public Vector3s(float x , float y , float z)
        {
            this.x = x; this.y = y; this.z = z;
        }

        public Vector3s(Vector3 other)
        {
            x = other.x; y = other.y; z = other.z;
        }

        public Vector3s(Vector2 other)
        {
            x = other.x; y = other.y;
        }

        public static implicit operator Vector2(Vector3s vec)
        {
            return vec.ToVector2();
        }

        public static implicit operator Vector3(Vector3s vec)
        {
            return vec.ToVector3();
        }
    }
}